/*
//
//              INTEL CORPORATION PROPRIETARY INFORMATION
//  This software is supplied under the terms of a license  agreement or
//  nondisclosure agreement with Intel Corporation and may not be copied
//  or disclosed except in  accordance  with the terms of that agreement.
//    Copyright (c) 2007-2008 Intel Corporation. All Rights Reserved.
//
//
*/

#ifndef __UMC_AVS_ENC_VLC_H
#define __UMC_AVS_ENC_VLC_H

#include "ippdefs.h"

namespace UMC
{

//
// declare VLC coding functions
//

IppStatus avs_EncodeLumaBlockIntra_AVS_1u16s(Ipp32u **ppBitStream,
                                             Ipp32s *pBitOffset,
                                             const Ipp16s *pDstCoeffs,
                                             Ipp32u scanType);

IppStatus avs_EncodeLumaBlockInter_AVS_1u16s(Ipp32u **ppBitStream,
                                             Ipp32s *pBitOffset,
                                             const Ipp16s *pDstCoeffs,
                                             Ipp32u scanType);

IppStatus avs_EncodeChromaBlock_AVS_1u16s(Ipp32u **ppBitStream,
                                          Ipp32s *pBitOffset,
                                          const Ipp16s *pDstCoeffs,
                                          Ipp32u scanType);

//
// declare getting size functions
//

Ipp32u avs_GetSizeLumaBlockIntra_AVS_1u16s(const Ipp16s *pDstCoeffs,
                                           Ipp32u scanType);

Ipp32u avs_GetSizeLumaBlockInter_AVS_1u16s(const Ipp16s *pDstCoeffs,
                                           Ipp32u scanType);

Ipp32u avs_GetSizeChromaBlock_AVS_1u16s(const Ipp16s *pDstCoeffs,
                                        Ipp32u scanType);

//
// declare VLC types & tables
//

enum
{
    NA                          = 63
};

struct AVS_ENC_ENTROPY_TABLE
{
    Ipp32u maxAmp;                                              // (Ipp32u) maximum allowed amplitude
    Ipp32u maxRun;                                              // (Ipp32u) maximum allowed run
    Ipp32u eobCode;                                             // (Ipp32u) end of block VLC code
    Ipp8u vlcCode[116];                                         // (Ipp8u []) tables of VLC codes
    Ipp8u ref_level[32];                                        // (Ipp8u []) RefAbsLevel values
};

extern const
AVS_ENC_ENTROPY_TABLE VLCEnc0_Intra;
extern const
AVS_ENC_ENTROPY_TABLE VLCEnc1_Intra;
extern const
AVS_ENC_ENTROPY_TABLE VLCEnc2_Intra;
extern const
AVS_ENC_ENTROPY_TABLE VLCEnc3_Intra;
extern const
AVS_ENC_ENTROPY_TABLE VLCEnc4_Intra;
extern const
AVS_ENC_ENTROPY_TABLE VLCEnc5_Intra;
extern const
AVS_ENC_ENTROPY_TABLE VLCEnc6_Intra;

extern const
AVS_ENC_ENTROPY_TABLE VLCEnc0_Inter;
extern const
AVS_ENC_ENTROPY_TABLE VLCEnc1_Inter;
extern const
AVS_ENC_ENTROPY_TABLE VLCEnc2_Inter;
extern const
AVS_ENC_ENTROPY_TABLE VLCEnc3_Inter;
extern const
AVS_ENC_ENTROPY_TABLE VLCEnc4_Inter;
extern const
AVS_ENC_ENTROPY_TABLE VLCEnc5_Inter;
extern const
AVS_ENC_ENTROPY_TABLE VLCEnc6_Inter;

extern const
AVS_ENC_ENTROPY_TABLE VLCEnc0_Chroma;
extern const
AVS_ENC_ENTROPY_TABLE VLCEnc1_Chroma;
extern const
AVS_ENC_ENTROPY_TABLE VLCEnc2_Chroma;
extern const
AVS_ENC_ENTROPY_TABLE VLCEnc3_Chroma;
extern const
AVS_ENC_ENTROPY_TABLE VLCEnc4_Chroma;

extern const
Ipp32u VLCEnc_IntraMaxRun[12];
extern const
Ipp32u VLCEnc_InterMaxRun[12];
extern const
Ipp32u VLCEnc_ChromaMaxRun[6];

} // namespace UMC

#endif // __UMC_AVS_ENC_VLC_H
